$(function(){
 
    $.ajaxSetup({ cache: false });



    $('#anniu').on('click',function(){
        layer.alert('调试中！即将上线！', {
            skin: 'layui-layer-lan' //样式类名
            ,closeBtn: 0
        } );
    });



    $('.show_line').on('click',function(){
        var gid=this.id;
        gid=gid.replace("show_line_","");
        showline("line_show","show_line",gid);
    });

    $('.hide_line').on('click',function(){
        var gid=this.id;
        gid=gid.replace("hide_line_","");
        showline("line_hide","hide_line",gid);
    });



    $('.copy_mb').on('click',function(){
        var gid=this.id;
        coid="#"+gid;

        if(coid.indexOf('copy_mb') >= 0)
        {  gid=gid.replace("copy_mb_","");
            if(gid.indexOf('gy') >= 0)
            {
                gid=gid.replace("gy_","");
                obi_id='gy_diy_show_'+gid;}
            else
            {obi_id='my_diy_show_'+gid;}
        }
        else
        {  gid=gid.replace("copy_ut_mb_","");
            obi_id='quan_goods_show_'+gid;
        }
        if ((navigator.userAgent.indexOf('MSIE') >= 0) || (navigator.userAgent.indexOf('Trident') >= 0) || (navigator.userAgent.indexOf('trident') >= 0))
        {
            var obj_mb=document.getElementById(obi_id);
            layer.tips('复制成功', coid);
            copyText(obj_mb);
        }
        else
        {

            layer.alert('请将浏览器切换到【IE模式】再复制！', {
                skin: 'layui-layer-lan'
                ,closeBtn: 0
                ,shift: 4 //动画类型
            });
        }
    });






function DoEmpty(id,words,url)
{
    if (confirm(words))
        location.href=url ;
}



function copyText(obj)
{
    var rng = document.body.createTextRange();
    rng.moveToElementText(obj);
    rng.scrollIntoView();
    rng.select();
    rng.execCommand("Copy");
    rng.collapse(false);
} 


});
